package com.ruoyi.project.simple.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.simple.mapper.SplAdvertisingMapper;
import com.ruoyi.project.simple.domain.SplAdvertising;
import com.ruoyi.project.simple.service.ISplAdvertisingService;

/**
 * 广告Service业务层处理
 * 
 * @author zhujj
 * @date 2020-01-15
 */
@Service
public class SplAdvertisingServiceImpl implements ISplAdvertisingService 
{
    @Autowired
    private SplAdvertisingMapper splAdvertisingMapper;

    /**
     * 查询广告
     * 
     * @param advertisingId 广告ID
     * @return 广告
     */
    @Override
    public SplAdvertising selectSplAdvertisingById(Integer advertisingId)
    {
        return splAdvertisingMapper.selectSplAdvertisingById(advertisingId);
    }

    /**
     * 查询广告列表
     * 
     * @param splAdvertising 广告
     * @return 广告
     */
    @Override
    public List<SplAdvertising> selectSplAdvertisingList(SplAdvertising splAdvertising)
    {
        return splAdvertisingMapper.selectSplAdvertisingList(splAdvertising);
    }

    /**
     * 新增广告
     * 
     * @param splAdvertising 广告
     * @return 结果
     */
    @Override
    public int insertSplAdvertising(SplAdvertising splAdvertising)
    {
        splAdvertising.setCreateTime(DateUtils.getNowDate());
        return splAdvertisingMapper.insertSplAdvertising(splAdvertising);
    }

    /**
     * 修改广告
     * 
     * @param splAdvertising 广告
     * @return 结果
     */
    @Override
    public int updateSplAdvertising(SplAdvertising splAdvertising)
    {
        splAdvertising.setUpdateTime(DateUtils.getNowDate());
        return splAdvertisingMapper.updateSplAdvertising(splAdvertising);
    }

    /**
     * 批量删除广告
     * 
     * @param advertisingIds 需要删除的广告ID
     * @return 结果
     */
    @Override
    public int deleteSplAdvertisingByIds(Integer[] advertisingIds)
    {
        return splAdvertisingMapper.deleteSplAdvertisingByIds(advertisingIds);
    }

    /**
     * 删除广告信息
     * 
     * @param advertisingId 广告ID
     * @return 结果
     */
    @Override
    public int deleteSplAdvertisingById(Integer advertisingId)
    {
        return splAdvertisingMapper.deleteSplAdvertisingById(advertisingId);
    }
}
